package com.lianrui.app.comments.service.impl;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.lianrui.app.comments.dao.ICommentsDao;
import com.lianrui.app.comments.domain.Comments;
import com.lianrui.app.comments.service.ICommentsService;
import com.lianrui.app.comments.vos.CommentsPage;
import com.lianrui.commons.exception.BusinessException;
import com.lianrui.core.AbstractService;
import com.lianrui.core.IDao;

@Service(value = "commentsService")
public class CommentsService extends
		AbstractService<CommentsPage, Comments, Integer> implements
		ICommentsService {
	private static final long serialVersionUID = 1L;
	private static final Logger LOGGER = LoggerFactory
			.getLogger(CommentsService.class);
	
	@Resource
	private ICommentsDao commentsDao;

	@Override
	public IDao<CommentsPage, Comments, Integer> getDao()
			throws BusinessException {
		return commentsDao;
	}

	@Override
	protected Logger getLogger() {
		return LOGGER;
	}

	@Override
	public int getCommentsCount(Integer orderId) {
		return commentsDao.getCommentCount(orderId);
	}

}
